warning('off','all')

global output_toolbox_ setup_ oo_ scale_ M_ options_;


                                
if irfI==1 && (gen_irfI + stoch_ss_irfI == 0);  disp('wrong options for IRF computatoin -- input_dynare_toolbox'); end

setup_.smoothing                 = 1600;
setup_.quarterly_conversion      = 0;
setup_.stdev_shocks              = [scale_.zP scale_.UzP]; 
setup_.pruning                   = pruningI;
setup_.hpfilter                  = hpfilterI;
setup_.gen_irf                   = gen_irfI;
setup_.stoch_ss_irf              = stoch_ss_irfI;
setup_.names                     = M_.endo_names(oo_.dr.order_var,:); % variables in DR options_.order (needed in DR options_.order since output from policy functions will be in DR options_.order)

setup_.numbersimul               = 2000;                         
                                       if setup_.stoch_ss_irf==1; setup_.numbersimul = 1;   end  
                                       
setup_.drop                      = 5000; 
                                       if hpfilterI==1; setup_.drop = 1000; end
                                       
setup_.lengthsimul               = setup_.drop + 50;                           
                                       if setup_.stoch_ss_irf==1; setup_.lengthsimul = setup_.drop + 50; end
                                       if hpfilterI==1; setup_.lengthsimul = 100; end
                                        
setup_.irf                       = irfI;
setup_.order                     = orderI;
setup_.scale_shock_1             = 1;
setup_.nokeyboard                = 0;
setup_.nodisplay                 = 0;
setup_.states_save               = 2; 

setup_.external_shocks           = 1;     
setup_.numbersimul               = 1;                          
setup_.hpfilter                  = 0;

setup_.shocks_matrix_external = vertcat(zeros(1,setup_.lengthsimul),zeros(1,setup_.lengthsimul),zeros(1,setup_.lengthsimul));

if (options_.periods~=0)
    setup_.numbersimul = 1; setup_.lengthsimul = options_.periods; setup_.drop = options_.drop; options_.order = options_.order;
end


if setup_.order==1
    setup_.type = 'empty';
    setup_.pruningI  = 0;  
end

if setup_.order==2
    setup_.type = 'kim_et_al';
end

if setup_.order==3
    setup_.type = 'andreasen';
end



output_toolbox_ = dynare_toolbox(M_,options_,setup_.order,setup_.type,setup_);

    
